# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: a821
# Contributor: asm0dey <pavel.finkelshtein+AUR@gmail.com>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>

pkgname=pgcli
pkgver=3.5.0
pkgrel=2
pkgdesc='A command line interface for PostgreSQL with auto-completion and syntax highlighting'
url='https://www.pgcli.com/'
arch=('any')
license=('BSD')
depends=(
  'python'
  'python-sqlparse'
  'python-psycopg'
  'python-click'
  'python-prompt_toolkit'
  'python-configobj'
  'python-pgspecial'
  'python-setproctitle'
  'python-cli_helpers'
  'python-keyring'
  'python-pygments'
  'python-pendulum'
  'python-setuptools'
)
makedepends=('git')
_commit='c280f8e398662e43a1637c6918700f0883baea1c'
source=("$pkgname::git+https://github.com/dbcli/pgcli.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python setup.py build
}

check() {
  cd "$pkgname"

}

package() {
  cd "$pkgname"

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt
}
